<template>
	<view class="conter">

		<header-box :title="title"></header-box>


		<u-search placeholder="搜索地址..." v-model="keyword" @blur="getList" :show-action="fasle">
		</u-search>

		<view class="conter-box1 flex-center" v-for="(item, index) in listfrom" :key="index" @click="listInfo(item.id)">
			<view class="conter-box-image">
				<image class="w200 h200 r10" :src="img + item.image" mode=""></image>
			</view>
			<view class="">
				<view class="" style="font-size: 28rpx;">
					{{item.name}}
				</view>
				<view class="" style="font-size: 26rpx; margin-top: 20rpx; white-space:nowrap;">
					<u-icon name="map" color="#717171" size="26"></u-icon> {{item.address}}
				</view>
			</view>
		</view>

		<view class="add" @tap="goBack('/pages/tab/me')">
			我的图册
		</view>

	</view>
</template>

<script>
	export default {
		components: {},
		data() {
			return {
				keyword: '',
				title: '场地资料',
				listfrom: [],
				img: this.$images,
			}
		},
		onLoad(e) {
			this.getList()
		},
		onShow() {},
		methods: {
			async getList() {
				const res = await this.$u.post('api/hotel/index', {
					address: this.keyword
				})
				this.listfrom = res.data
				console.log(res)
			},

			goBack(url) {
				uni.navigateTo({
					url,
				})
			},

			// async getListfrom() {

			// 	const res = await this.$u.post('api/hotel.Index/lists' )
			// 	this.flowList = res.data
			// 	console.log('请求列表', this.flowList)
			// },

			listInfo(id) {
				uni.navigateTo({
					url: '/pages/site/hotelInfo?info=' + 1 + '&id=' + id
				})
			},
			// address 默认空

		}
	}
</script>

<style lang="scss" scoped>
	.conter {
		width: 100%;
		height: 100%;
		padding: 0 30rpx;
		background-color: #FFFFFF !important;

		// image {
		// 	width: 100%;
		// 	height: 100%;
		// }

		.add {
			position: fixed;
			bottom: 200rpx;
			right: 0rpx;
			text-align: center;
			font-size: 26rpx;
			color: #FFFFFF;
			width: 202rpx;
			height: 70rpx;
			line-height: 70rpx;
			background: #7578EF;
			border-radius: 35px 0px 0px 35px;
		}

		.conter-box1 {
			// height: 170rpx;
			margin-top: 20rpx;
			padding: 20rpx 0;
			border-bottom: 1rpx solid #eee;

			.conter-box-image {
				width: 200rpx;
				height: 200rpx;
				margin-right: 20rpx;
			}

			/deep/.box-fright {
				margin-left: 20rpx !important;
				// display: flex;
				// justify-content: space-between !important;
			}
		}

	}
</style>
